package com.hxkj.dao.impl;

import com.hxkj.dao.ArticleTagsDao;
import com.hxkj.domain.po.Article;
import com.hxkj.mapper.ArticleTagsMapper;
import com.hxkj.domain.po.ArticleTags;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;


/**
* 数据操作实现
*
* @author: chenwei
* @version: 1.0
* @datetime: 2018-06-07 17:08:10
*
*/
@Service("articleTagsDao")
public class ArticleTagsDaoImpl implements ArticleTagsDao {

    @Resource
    private ArticleTagsMapper articleTagsMapper;

    @Override
    public ArticleTags get(Long id) {
        return articleTagsMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<ArticleTags> get(ArticleTags articleTags) {
        return articleTagsMapper.select(articleTags);
    }

    @Override
    public int delete(Long id) {
        return articleTagsMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int delete(ArticleTags articleTags) {
        return articleTagsMapper.delete(articleTags);
    }

    @Override
    public int save(ArticleTags articleTags) {
        return articleTagsMapper.insert(articleTags);
    }

    @Override
    public int update(ArticleTags articleTags) {
        return articleTagsMapper.update(articleTags);
    }

    @Override
    public int removeArticleTagsByTagsId(Long tagsId) {
        return articleTagsMapper.removeArticleTagsByTagsId(tagsId);
    }

    @Override
    public List<Article> getTagsArticle(ArticleTags articleTags) {
        return articleTagsMapper.getTagsArticle(articleTags);
    }
}
